﻿/**
* userService - AngularJS module for web api management.
*
*
* Credits
* =======
*
* Copyright 2016 LonghronShen <LonghronShen@Hotmail.com>
*/

(function () {
    "use strict";

    /**
     * Config
     */
    var moduleName = 'ccp';
    var DEFAULT_ID = '__default';

    /**
     * Module
     */
    var module;
    try {
        module = angular.module(moduleName);
    } catch (err) {
        // named module does not exist, so create one
        module = angular.module(moduleName, []);
    }

    module.service('userService', ["$rootScope", "$http", "$q", "dataService", function ($rootScope, $http, $q, dataService) {
        return {
            login: function (email, password) {
                return dataService.login(email, password);
            },

            logout: function (token) {
                return dataService.logout(token);
            }
        }
    }]);
})();